function mov=newmovie(avi_file,varargin)
% newmovie: Create a new movie object for saving as an .AVI file
%
% SYNTAX:
%   mov = newmovie(avi_file,prop1,value1,...)
%   Return generated MADS.Movie object mov with specified properties and avi file name
%   Type "newmovie('test.avi')" to see available properties and their default values. 

%   Author: Hongbin Ma
%   Last updated: 2009-6-2 with MATLAB 6.5
%   Problems or suggestions? Email me: mathmhb[at]163.com

mov=struct('type','MADS.movie',varargin{:});
mov.avifile=avi_file;
mov.parameters=varargin;
clear mex;
mov.aviobj=avifile(avi_file,varargin{:});
mov.aviobj=set_field(mov.aviobj,'Compression','Cinepak');
